package com.zcx.liu_zi_qi

import android.content.Intent
import android.os.Bundle
import android.os.PersistableBundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import android.widget.Toast

class MainActivity:AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    /**
     * 人机对战
     */
    fun onRenJi(view:View){
        Toast.makeText(this,"正在进入人机对战", Toast.LENGTH_SHORT).show()
        val intent=Intent()
        intent.setClass(this,GameActivity::class.java)
        intent.putExtra("model",GameModel.RENJI)
        startActivity(intent)
    }

    /**
     * 双人PK
     */
    fun onTwo(view:View){
        Toast.makeText(this,"正在进入双人对战", Toast.LENGTH_SHORT).show()
        val intent=Intent()
        intent.setClass(this,GameActivity::class.java)
        intent.putExtra("model",GameModel.TWO)
        startActivity(intent)
    }

    /**
     * 蓝牙对战
     */
    fun onLanYa(view:View){
        Toast.makeText(this,"正在进入蓝牙对战", Toast.LENGTH_SHORT).show()
        val intent=Intent()
        intent.setClass(this,GameActivity::class.java)
        intent.putExtra("model",GameModel.LANYA)
        startActivity(intent)
    }
}